#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    vector<int> singleNumber(vector<int>& nums)
    {
		int ret = 0;
		for (auto f : nums)
		{
			ret ^= f;
		}
		int i = 0, m = 0, n = 0;
		for (i = 0; i < 32; i++)
		{
			if (((ret >> i) & 1) == 1)
			{
				break;
			}
		}
		for (const auto &e : nums)
		{
			if (((e >> i) & 1) == 1)
			{
				m ^= e;
			}
			else
			{
				n ^= e;
			}
		}
		vector<int>v(2);
		v[0] = m, v[1] = n;
		return v;
    }
};
int main()
{
	Solution xz;
	vector<int> v;
	v.push_back(1);
	v.push_back(2);
	v.push_back(1);
	v.push_back(3);
	v.push_back(2);
	v.push_back(5);

	vector<int> v2 = xz.singleNumber(v);
	for (auto n : v2)
	{
		printf("%d ", n);
	}

	return 0;
}